package com.hd.bean;

import java.io.Serializable;

import com.hd.until.*;
import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.util.Date;


public class AnShuoRequest implements Serializable {

    private static final long serialVersionUID = 6695347677530587795L;

    private static final String MTP_CHANNEL_TYPE = "HDJF-SER-MTP";

    @JSONField(name = "Transaction")
    private AnShuoRequestTransaction transaction;

    public AnShuoRequestTransaction getTransaction() {
        return transaction;
    }

    public void setTransaction(AnShuoRequestTransaction transaction) {
        this.transaction = transaction;
    }

    public AnShuoRequest(String serviceCode, AnShuoRequestTransBody transBody) {
        transaction = new AnShuoRequestTransaction();
        AnShuoRequestTransHeader header = new AnShuoRequestTransHeader();
        header.setTransId("trans_id");
        header.setServiceCode(serviceCode);
        header.setChannelType(MTP_CHANNEL_TYPE);
        Date current = new Date();
        header.setTransDate(DateFormatUtil.formatDate(current, "yyyy/MM/dd"));
        header.setTransTime(DateFormatUtil.formatDate(current, "HH:mm:ss"));
        transaction.setTransHeader(header);
        transaction.setTransBody(transBody);
    }
    
    public String toString() {
    	return LogFilterUtil.toFilteredString(this);
    }
}
